package com.significantfiles.snapshot.util;

public class EntitySpaceNameUtil {

	
	public final static String calcDirName( final Class<?> type ) {
		final String fqClassName = type.getName();
		final String[] nameParts = fqClassName.split("\\.");

		final StringBuilder buffer = new StringBuilder(fqClassName.length());

		for (int i = 0; i < (nameParts.length - 1); i++) {
			final String namePart = nameParts[i];
			final char firstChar = namePart.charAt(0);

			buffer.append(firstChar);
		}

		final String simpleName = nameParts[nameParts.length - 1];
		buffer.append(simpleName);

		return buffer.toString();
	}
}
